﻿@{
    Layout = null;
}

<h2>CheckEmpLoginState</h2>
<link href="~/Content/css/bootstrap.min.css" rel="stylesheet" />
<script src="~/Scripts/js/jquery.min.js"></script>
<script src="~/Scripts/js/bootstrap.min.js"></script>


<span><b>选择当前用户状态：</b></span>
<select id="PersonState" style="height:30px;width:80px;">
    <option value="0">在职</option>
    <option value="1">实习</option>
    <option value="2">离职</option>
    <option value="3">试用</option>
</select><br />
<input type="button" value="提交" class="btn btn-success" style="padding-left:30px;padding-right:30px;margin-top:30px;" onclick="SubmitLoginState()" />
<input type="button" value="返回" class="btn btn-danger" style="padding-left:30px;padding-right:30px;margin-left:30px;margin-top:30px;" onclick="BackIndex()" />
<script>
    var PersonState = '@ViewBag.PersonState';
    $("#PersonState").val(PersonState);

    //提交用户状态
    function SubmitLoginState() {
        $.ajax({
            type: "post",
            url: "/Employee/SubmitLoginState",
            data: { PersonState: $("#PersonState").val(), EmpId: '@ViewBag.EmpId' },
            success: function (obj) {
                if (obj > 0) {
                    location.href = '/Employee/ManageEmployee';
                }
            }
        })
    }

    //返回
    function BackIndex() {
        location.href = '/Employee/ManageEmployee';
    }
</script>